<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/view/common/taglibs.jsp" %>
<script type="text/javascript">
	function selectUser(){
		var url= "<s:property value='contextPath'/>/system/user/chooseMulti.do?allIds="+$("#users_id").val();
		
		window.open(url,'选择用户','height=900,width=1024,top=0,left=200,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');
	}
	function selectOper(){
		var url= "<s:property value='contextPath'/>/system/role/selectOper.do?codes="+$("#opers_code").val();
		
		window.open(url,'设置权限','height=900,width=1024,top=0,left=200,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');
	}
	function choose_user(ids,names){
		$("#users_id").val(ids);
		$("#users_name").html(names);
	}
	function choose_oper(codes,names){
		$("#opers_code").val(codes);
		$("#opers_name").html(names);
	}
</script>
	<input type='hidden' name='id' value='<s:property value='entity.id'/>' />
	<input type='hidden' name='redirectUrl' value='<s:property value='redirectUrl'/>' />
	
	<table width="100%" border="0" cellpadding="1" cellspacing="1">
		<tr>
			<td class="left-td-width-bg">
				<font color="red">*</font>角色名：
			</td>
			<td>
				<input name="entity.roleName" class="input" type="text" id="code" size="16"
					value="<s:property value='entity.roleName'/>" dataType="Require|Unique"  msg="必填项|角色名必须是唯一" classType="com.jysz.certificate.persistence.model.system.Role" valProperty="roleName" entityId="${entity.id}" contextPath="${contextPath}"/>
			</td>
			<td class="left-td-width-bg">
				备注：
			</td>
			<td>
				<input name="entity.memo" class="input"  type="text" id="name" size="16"
					 value="<s:property value='entity.memo'/>"/>
			</td>			
		</tr>
		<tr>
			<td class="left-td-width-bg">
				用户：
			</td>
			<td colspan="3">
				<textarea id="users_name" name="entity.code"  class="input_textarea_width60" rows="6" cols="50" readonly="readonly" ><s:property value="userNames"/></textarea>
				<a href="javascript:selectUser();">
					<img src="${contextPath}/images/chakan.gif">
				</a>
			</td>
		</tr>
		<tr>
			<td class="left-td-width-bg">
				权限：
			</td>
			<td colspan="3">
				<textarea id="opers_name" name="entity.code" class="input_textarea_width60"  rows="6" cols="50" readonly="readonly" ><s:property value="operNames"/></textarea>
				<a href="javascript:selectOper();">
					<img src="${contextPath}/images/chakan.gif">
				</a>
			</td>			
		</tr>

	</table>
	 <table width="100%">
            	<tr>
                	<td><div align="center">
                	<input type="hidden" name="entity.id" value="<s:property value='entity.id'/>">
                	<input type="hidden" id="users_id" name="userIds" value="<s:property value='userIds'/>">
                	<input type="hidden" id="opers_code" name="codes" value="<s:property value='codes'/>">
                	  <input type="submit" name="submit" value="" class="btn_save" />
                	&nbsp;&nbsp;
                      <input type="reset" name="reset" value="" class="btn_rest" onclick="clearForm(this.form);return false;"/>
                    </div>
                    </td>
                </tr>
     </table>        